/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "TYPECT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Typect.findAll", query = "SELECT t FROM Typect t"),
    @NamedQuery(name = "Typect.findByNumtypect", query = "SELECT t FROM Typect t WHERE t.numtypect = :numtypect"),
    @NamedQuery(name = "Typect.findByIntituletypect", query = "SELECT t FROM Typect t WHERE t.intituletypect = :intituletypect"),
    @NamedQuery(name = "Typect.findByCgprincipal", query = "SELECT t FROM Typect t WHERE t.cgprincipal = :cgprincipal")})
public class Typect implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "NUMTYPECT")
    private Integer numtypect;
    @Column(name = "INTITULETYPECT")
    private String intituletypect;
    @Column(name = "CGPRINCIPAL")
    private Integer cgprincipal;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "typect")
    private Collection<Comptet> comptetCollection;

    public Typect() {
    }

    public Typect(Integer numtypect) {
        this.numtypect = numtypect;
    }

    public Integer getNumtypect() {
        return numtypect;
    }

    public void setNumtypect(Integer numtypect) {
        this.numtypect = numtypect;
    }

    public String getIntituletypect() {
        return intituletypect;
    }

    public void setIntituletypect(String intituletypect) {
        this.intituletypect = intituletypect;
    }

    public Integer getCgprincipal() {
        return cgprincipal;
    }

    public void setCgprincipal(Integer cgprincipal) {
        this.cgprincipal = cgprincipal;
    }

    @XmlTransient
    public Collection<Comptet> getComptetCollection() {
        return comptetCollection;
    }

    public void setComptetCollection(Collection<Comptet> comptetCollection) {
        this.comptetCollection = comptetCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numtypect != null ? numtypect.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Typect)) {
            return false;
        }
        Typect other = (Typect) object;
        if ((this.numtypect == null && other.numtypect != null) || (this.numtypect != null && !this.numtypect.equals(other.numtypect))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Typect[ numtypect=" + numtypect + " ]";
    }
    
}
